/**
 * Project Name:bfs_v1.0.1
 * File Name:ButtonServiceImpl.java
 * Package Name:com.zeei.bfs.service.impl
 * Date:2016年12月22日下午4:57:23
 * Copyright (c) 2016, ZEEI All Rights Reserved. *
 *
 * ClassName:ButtonServiceImpl 
 * Function: TODO ADD FUNCTION.  
 * @author   zws 
 * @since    JDK 1.8	 
 */

package com.zeei.bfs.service.impl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zeei.bfs.dao.ButtonDao;
import com.zeei.bfs.service.ButtonService;
import com.zeei.bfs.vo.ButtonVO;

@Service("buttonService")
public class ButtonServiceImpl implements ButtonService{

	@Autowired
	private ButtonDao buttonDao;
	
	@Override
	public List<ButtonVO> queryUserButton(Integer menuId, Integer userId) {
		if(menuId==null || userId==null){
			return new ArrayList<ButtonVO>();
		}
		Map<String, Object> condition=new HashMap<String,Object>();
		condition.put("userId", userId);
		condition.put("menuId", menuId);
		List<ButtonVO> buttonList=buttonDao.queryUserButtonByCondition(condition);
		return buttonList;
	}
	
	
	@Override
	public List<ButtonVO> queryButton(Integer menuId) {
		if(menuId==null){
			return new ArrayList<ButtonVO>();
		}
		Map<String, Object> condition=new HashMap<String,Object>();
		condition.put("menuId", menuId);
		List<ButtonVO> buttonList=buttonDao.queryMenuButtonByCondition(condition);
		return buttonList;
	}

}

